<template>
  <div class="topHeader">
    <div class="headerWra">
      <div class="comPoneyName">
        <img src="../../assets/img/logoSmall.png" alt="">
        <span>康远CMS后台管理系统</span>
      </div>
      <div class="userInfo">
        <span>{{userName}}</span>
        <i class="icon iconfont icon-084tuichu" @click="nav_exit"></i>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data(){
    return{
      userName:''
    }
  },
  created(){
    this.userName = sessionStorage.userName;
  },
  methods:{
      nav_exit() {
          sessionStorage.clear();
          this.$router.push({path: '/login'});
      }
  }
}
</script>
<style>
.topHeader{
  position: fixed;
  left: 0;
  top: 0;
  z-index: 999;
  width: 100%;
  height: 100px;
  background: #2c3147;
}
.topHeader .headerWra{
  color: #fff;
  display: -webkit-flex;
  display: flex;
  line-height: 100px;
  justify-content: space-between;
  padding: 0 40px;
}
.topHeader .headerWra .comPoneyName,.topHeader .headerWra .userInfo{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
}
.topHeader .headerWra .comPoneyName img{
  width: 25px;
  height: 24px;
  vertical-align: middle;
  margin-right: 10px;
}
.topHeader .headerWra .comPoneyName span{
  font-size: 24px;
  vertical-align: middle;
}
.topHeader .headerWra .userInfo img{
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.topHeader .headerWra .userInfo span{
  font-size: 16px;
  margin-right: 10px;
}
</style>

